package com.leo.basic.scheduler.quartz;

import com.leo.basic.scheduler.bean.SchedulerJob;
import com.leo.basic.utils.TaskUtils;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.PersistJobDataAfterExecution;

/**
 * @ClassName NonConcurrentJob
 * @Description 禁止并发执行，同一个任务如果一次执行多个会相互影响则使用此任务。同时jobdata中的共同变量也会等上一个任务执行完，才会触发下一个任务
 * @Author wangss
 * @date 2021.09.22 21:44
 * @Version 1.0
 */
@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class NonConcurrentJob extends AbstractSchedulerJob {
    @Override
    public void executeInternal(SchedulerJob schedulerJob) throws Exception {
        TaskUtils.invokeMethod(schedulerJob);
    }
}
